import org.junit.Test;
import static org.junit.Assert.*;

public class UnitTest {

	@Test
	public void KonstructorTest() {

		int tv;
		Node tnod1;
		Node tnod2;
		for (int i = 0; i <= 2500; i++) {

			tv = (int) (Math.random() * 1000);
						
			Node nod = new Node(tv);
			
			assertTrue("Konstruktor  (int) - " + tv, nod.getValue() == tv);
			assertTrue("Konstruktor(int) - " + tv, nod.getLeft() == null);
			assertTrue("Konstruktor (int) - " + tv, nod.getLeft() == null);

		}

		for (int i = 0; i <= 2500; i++) {

			tv = (int) (Math.random() * 1000);
			tnod1 = new Node((int) Math.random() * 1000);
			tnod2 = new Node((int) Math.random() * 1000);

			Node nod = new Node(tnod1, tnod2, tv);
			assertTrue("Konstruktor(node, node, int)", nod.getValue() == tv);
			assertTrue("Konstruktor(node, node, int)", nod.getLeft().equals(
					tnod1));
			assertTrue("Konstruktor(node, node, int)", nod.getRight().equals(
					tnod2));

		}

		for (int i = 0; i <= 2500; i++) {

			Node nod = new Node();
			assertTrue("Konstruktor()", nod.getValue() == null);
			assertTrue("Konstruktor()", nod.getLeft() == null);
			assertTrue("Konstruktor()", nod.getRight() == null);

		}

	}

	@Test
	public void SetterTest() {

		Node nod = new Node();
		int tv;
		Node tnod1;
		Node tnod2;

		for (int i = 0; i <= 2500; i++) {

			tv = (int) (Math.random() * 1000);
			tnod1 = new Node((int) Math.random() * 1000);
			tnod2 = new Node((int) Math.random() * 1000);
			
			nod.setValue(tv);
			nod.setLeft(tnod1);
			nod.setRight(tnod2);

			assertTrue("Getter/Setter - " + tv, nod.getValue() == tv);
			assertTrue("Getter/Setter - " + tv, nod.getLeft().equals(tnod1));
			assertTrue("Getter/Setter - " + tv, nod.getRight().equals(tnod2));

		}

	}
	
	@Test
	public void walkThroughTest(){
		
		Integer[] tv = new Integer[10];
		
		for(int i = 0; i<10; i++){
			
			
			
		}
		
			
		
		
		
	}
}
